Lien vers github : https://github.com/kounen/FrenchPresidentsInvestitureSpeech
# Uncomment to install
# install.packages("dplyr")
# install.packages("tidytext")
# install.packages("stopwords")
# install.packages("SnowballC")
# install.packages("ggraph")
# install.packages("tidyr")
# install.packages("tidygraph")
# install.packages("widyr")
library(dplyr) # pipe operator
library(tidytext) # unnest_tokens
library(stopwords) # to remove french and english stop words
library(SnowballC) # for stemming
library(ggraph) # for visual graph construction
library(tidyr) # for pivot_wider() function
library(tidygraph) # for data graph construction
library(widyr) # for pairwise_cor()
speeches_data <- read.csv('data/Speeches.csv', sep=';')
speeches_data
## President
## 1 Emmanuel Macron (2022)
## 2 Emmanuel Macron (2017)
## 3 François Hollande (2012)
## 4 Nicolas Sarkozy (2007)
## 5 Jacques Chirac (2002)
## 6 Jacques Chirac (1995)
## 7 François Mitterrand (1988)
## 8 François Mitterrand (1981)
## 9 Valéry Giscard d'Estaing (1974)
## Speech
## 1 Ladies and Gentlemen, At a time when the French have once again entrusted me with their highest office, I am acutely aware of the seriousness of the times. From the return of war to Europe, to pandemics, to the ecological emergency and so many of the crises you have just mentioned, Mr. President, rarely have our world and our country been faced with such a combination of challenges. Where many peoples have decided to withdraw, sometimes giving in to nationalist temptation, nostalgia for the past, the siren calls of ideologies whose shores we thought we had left in the previous century, the French people have chosen a clear and explicit project for the future. A republican and European project, a project of independence in a destabilized world, a project of scientific, social and ecological progress, a project faithful to the spirit which, since the Enlightenment, has never ceased to blow across our land, turning its back on facile demagoguery. This choice is part of the history of our Republic, and the presence here of my two predecessors, whom I thank for this, bears witness to this. This sovereign choice obliges me, for it is indeed the French people, the people who appoint their representatives and in particular the President of the Republic, who invest me with this mandate on this day. Yes, the French people have not extended the mandate that is coming to an end, which began on May 14, 2017. This new people, different from 5 years ago, has entrusted a new President with a new mandate. The time ahead will be one of resolute action for France and Europe. Firstly, to avoid any escalation following Russia's aggression in Ukraine, to help democracy and courage prevail, and to build a new European peace and autonomy on our continent. Act to make our country a stronger agricultural, industrial, scientific and creative power by simplifying our rules and investing in the France of 2030. Act to build a society of full employment and fair sharing of added value, because France needs to continue to produce and innovate more. Acting to make our country the great ecological power it needs to be, by radically transforming the way we produce, move and live, both in France and in our overseas territories. Take action to continue to tackle inequalities at their root, by overhauling our schools and healthcare systems. A school that is ever more inclusive, that trains students in fundamental knowledge and forges republican mindsets. A school open to culture and sports, we who will have to host the Olympic Games in 2024. Accessible healthcare throughout the country, through training, improved working conditions and better disease prevention. Acting to continue building progress for everyone, and working towards equality between men and women. Acting to continue to protect our compatriots through a strong, committed army on every continent, and by fighting against the insecurities of everyday life, the ever-present threat of terrorism and new threats such as cyber. Finally, we must act to unite our territories, from rural areas to working-class neighborhoods, from metropolises to our overseas territories. Yes, to act relentlessly on a course: to be a more independent Nation, to live better, and to build our French and European responses to the challenges of our century. This action, as we all know, comes at a time in our Nation's life when fears are numerous, as are fractures. Taking action, therefore, will not mean administering the country, chaining reforms together as if we were handing ready-made solutions to our people. Action, in these times, goes hand in hand with unity, respect, consideration and association for all. That's why we need to work together to invent a new method, far removed from worn-out rituals and choreographies, by which we alone can build a new productive, social and ecological contract. Gathering and pacifying cannot mean accepting to do nothing or forgetting our responsibilities. By sharing objectives, ambitions and responsibilities at a national level, by getting the government, its administration, parliament, social partners and associations to work together, and by involving all the political, economic, social and cultural driving forces throughout the country in deciding what to do, by planning, reforming and involving, I'm sure that our country will be able to decide on major national ambitions and at the same time unleash creativity and initiatives throughout the country. Above all, this will be the foundation of the democratic renaissance our country needs. Of course, it will also be institutional and political, but it must be in deed and in everyday practice, and everyone will have their share of responsibility. Ladies and Gentlemen, our past is ardent testimony to this. It is in the most difficult times that France reveals the best of itself. It is when the winds of tragedy blow that we French find the strength to rise above ourselves to write history in the ink of the universal. Here we are, at a time when the century is turning upside down and, in the midst of global upheaval, we have to chart a course and show the way. I'm convinced. Let's have the courage to look reality in the face, so that we can put our ideals into practice, rather than indulging in illusory pipe dreams. Let's be faithful to the values of liberty, equality, fraternity and secularism that have guided us since 1789, and which we collectively chose on April 24. Let's cherish the millennia-old history that binds us together, this unique culture, this language that Abbé Grégoire called the idiom of the universal. Let's continue to love the Republic and everything it stands for. The pre-eminence of the general will over particular interests, recognition of the verdict of the ballot box, respect for the law as the keystone of the social contract. Let's love our homeland, like this treasure trove of geography and landscapes, where from the plateau of Gergovie to the confines of the Marquesas Islands, from the Pyrenees of my childhood to my Picardy plains, you can feel the heartbeat of this ancient, deeply-rooted people who offered the world its wildest dreams: humanism, enlightenment, human rights. So, yes, France will continue to inspire the world. I know I am indebted to the French people for the trust they have placed in me. This ever-fragile trust, called into question every morning, is the foundation of our system of freedom. Each day of my new term of office, I shall have but one compass: to serve. To serve our country, a miracle of human will and freedom. To serve our fellow citizens, whose sense of duty and love of country are our greatest assets. To serve our children and young people, to whom my thoughts turn at this moment, and to whom I vow to bequeath a more liveable planet and a stronger, more vibrant France. Vive la République, Vive la France.
## 2 Ladies and Gentlemen, On May 7th, as you reminded us, the French chose hope and the spirit of conquest. The whole world watched our presidential election. Everywhere, people wondered whether the French would in turn decide to retreat into the illusory past, whether they would break with the march of the world, leave the stage of History, give in to democratic defiance, the spirit of division and turn their backs on the Enlightenment, or whether, on the contrary, they would embrace the future, collectively give themselves new impetus, reaffirm their faith in the values that have made them a great people. On May 7, the French chose. I would like to take this opportunity to thank them. The responsibility they have entrusted to me is an honor, the gravity of which I am fully aware. Today, more than ever, the world and Europe need France. They need a France that is strong and sure of its destiny. They need a France that raises its voice for freedom and solidarity. They need a France that knows how to invent the future. The world needs what the French have always taught it: the audacity of liberty, the demand for equality, the will for fraternity. Yet, for decades now, France has been doubting itself. It feels that its culture, its social model and its deeply held beliefs are under threat. She doubts what made her. That's why my mandate will be guided by two requirements. The first will be to restore the French people's self-confidence, which has been weakened for too long. I assure you, I didn't think for a second that it would magically return on the evening of May 7. It will be a slow, demanding but essential task. It will be up to me to convince French men and women that our country, which today seems to be battered by the sometimes contrary winds of the world's course, has within it all the resources to rank among the leading nations. I will convince our compatriots that France's power is not in decline, but that we are on the cusp of an extraordinary renaissance, because we hold in our hands all the assets that will and do make the great powers of the 21st century. To this end, I will not back down on any of the commitments I have made to the French people. Everything that contributes to France's strength and prosperity will be implemented: work will be freed up, businesses will be supported, initiative will be encouraged. Culture and education, through which emancipation, creation and innovation are built, will be at the heart of my action. French men and women who feel forgotten by this vast global movement must be better protected. Everything that forges our national solidarity will be recast, reinvented and strengthened. Equality in the face of life's accidents will be reinforced. Everything that makes France a safe country, where people can live without fear, will be amplified. Republican secularism will be defended, and our forces of law and order, our intelligence services and our armies will be strengthened. Europe, which we need, will be rebuilt and relaunched, because it protects us and enables us to carry our values around the world. Our institutions, decried by some, must regain the effectiveness in the eyes of the French that has ensured their longevity. I believe in the institutions of the V? Republic and will do everything in my power to ensure that they function in the spirit in which they were created. To this end, I will ensure that our country enjoys renewed democratic vitality. Citizens will have their say. They will be listened to. In this fight, I'll need everyone's help. The responsibility of all the elites - political, economic, social, religious - of all the constituted bodies of the French Nation, will be called upon. We can no longer take refuge behind customs and habits that are sometimes out of date. We need to rediscover the profound meaning and dignity of what brings us together today: acting fairly and effectively for our people. France is only strong if it is prosperous. France is only a model for the world if it is exemplary. And this is my second demand. Because we will have restored to the French a taste for the future and pride in who they are, the whole world will be attentive to France's word. Because together we will have overcome our fears and anxieties, together we will set an example of a people able to assert its values and principles, which are those of democracy and the Republic. The efforts of my predecessors in this direction have been remarkable, and I would like to pay tribute to them. I'm thinking of General de Gaulle, who worked to restore France to its rightful place in the concert of nations. I'm thinking of Georges Pompidou, who made our country a major industrial power. Valéry Giscard d'Estaing, who brought France and its society into the modern age. To François Mitterrand, who helped reconcile the French dream with the European dream. To Jacques Chirac, who gave us the standing of a nation able to say no to the pretensions of the warmongers. To Nicolas Sarkozy, who spared no effort to resolve the financial crisis that so violently struck the world. And I'm thinking, of course, of François Hollande, forging ahead with the Paris Climate Agreement and protecting the French in a world struck by terrorism. Their work, especially in recent decades, has all too often been hampered by a deleterious domestic climate, by the discouragement of French people who feel unjustly underprivileged, downgraded or forgotten. What France has to say to the world has sometimes been weakened by a domestic situation riddled with anxiety and even mistrust. Today, Ladies and Gentlemen, the time has come for France to rise to the occasion. The divisions and fractures running through our society must be overcome, be they economic, social, political or moral; for the world expects us to be strong, solid and clear-sighted. France's mission in the world is eminent. We will shoulder all our responsibilities to provide an appropriate response to major contemporary crises, whenever necessary. Whether it's the migratory crisis, the climate challenge, authoritarian excesses, the excesses of global capitalism or, of course, terrorism, nothing now strikes one and spares the others. We are all interdependent. We are all neighbors. France will always stand up for freedom and human rights, but always to build peace over the long term. We have an immense role to play: correcting the excesses of the world's course, and ensuring the defense of freedom. That is our vocation. To do this, we need a more efficient, more democratic and more political Europe, which is the instrument of our power and sovereignty. I will work to achieve this. Geography has become much smaller. But time has accelerated. We are living in a period that will determine France's destiny for decades to come. We won't be fighting just for this generation, but for generations to come. It is up to all of us, here and now, to decide on the world in which these generations will live. This is perhaps our greatest responsibility. We must build the world our young people deserve. I know that the French people expect a great deal from me at this time. They are right to do so, because the mandate they have entrusted me with gives them the right to demand the utmost of me. I am fully aware of this. Nothing will be taken for granted or compromised. Nothing will weaken my resolve. Nothing will deter me from defending France's superior interests at all times and in all places. At the same time, I will constantly strive to reconcile and unite all French people. The confidence shown in me by the French people fills me with immense energy. My actions will be guided by the certainty that together we can write one of the finest pages in our history. In those moments when everything can be turned upside down, the French people have always been able to find the energy, the discernment and the spirit of harmony to bring about profound change. That's where we are now. It is for this mission that I will humbly serve our people. I know that I can count on all our compatriots to carry out the considerable and exhilarating task that awaits us. As far as I'm concerned, I'll be getting down to work this evening.
## 3 Mr. President, Ladies and Gentlemen Ladies and Gentlemen On this day when I am invested with the highest office in the land, I address a message of confidence to the French people. We are a great country which, throughout its history, has always been able to face up to the trials and challenges it has faced. Each time, it has succeeded, while remaining true to itself. Always elevated and open. Never lowered and withdrawn. This is the mandate I received from the French people on May 6th: to put France back on its feet with justice. To open up a new path in Europe. To contribute to world peace and the preservation of our planet. I am aware of the weight of the constraints we face: massive debt, weak growth, high unemployment, deteriorating competitiveness and a Europe struggling to emerge from the crisis. But I'm here to affirm that there is no inevitability, as long as we have a shared determination, a clear direction and a full mobilization of our strengths and assets. They are considerable: the productivity of our workforce, the excellence of our researchers, the dynamism of our entrepreneurs, the hard work of our farmers, the quality of our public services, the influence of our culture and language, not to mention the vitality of our demography and the impatience of our youth. The first condition for renewed confidence is the unity of the Nation. Our differences must not become divisions. Our differences into discord. The country needs appeasement, reconciliation and unity. It is the role of the President of the Republic to contribute to this. To bring all French people together, without distinction, around the same values, those of the Republic. That is my imperative duty. Whatever our age, whatever our convictions, wherever we live - in France or overseas - in our cities, our neighborhoods and our rural areas, we are France. A France not pitted against another, but a France united in the same community of destiny. And in all circumstances, I will reaffirm our intangible principles of secularism, just as I will fight against racism, anti-Semitism and all forms of discrimination. Confidence also means setting an example. As President of the Republic, I will fully assume the exceptional responsibilities of this high mission. I will set the priorities, but I will not decide everything, nor will I decide for everyone. In accordance with the Constitution, the government will determine and conduct the Nation's policy. Parliament's rights will be respected. Justice will have every guarantee of independence. State power will be exercised with dignity and simplicity. With great ambition for the country. And scrupulous sobriety in behavior. The State will be impartial, because it is the property of all French people, and therefore does not belong to those who have been entrusted with it. The rules governing the appointment of public officials will be regulated. And loyalty, competence and a sense of the general interest will be the sole criteria for determining my choices for the highest servants of the State. France is fortunate to have a high-quality civil service. I would like to express my gratitude and the expectations I place in it and in each of its employees. Trust lies in democracy itself. I believe in local democracy, and I intend to revitalize it through a new act of decentralization that is likely to give new freedoms for the development of our territories. I believe in social democracy, and new areas for negotiation will be opened up to the social partners, both employee representatives and professional organizations, whom I will respect. I believe in citizen democracy, in associations and civic commitments, which will be supported for the millions of volunteers who devote themselves to them. Trust is based on fair choices. Justice in the very concept of wealth creation. It's time to put production before speculation, investment in the future before present satisfaction, sustainable employment before immediate profit. It's time to embark on the energy and ecological transition. It's time to open up a new frontier for technological development and innovation. But there must also be justice in the distribution of the indispensable effort. We can't have sacrifices for some, who are ever more numerous, and privileges for others, who are ever less numerous. This will be the thrust of the reforms that the government will carry out, with the aim of rewarding merit, hard work and initiative, and discouraging rents and exorbitant remuneration. Justice will be the criterion on which every public decision is based. Finally, the Republic must place its trust in young people. I will give them back their rightful place, the first place. This is the basis of my commitment to the schools of the Republic, for their mission is vital to the cohesion of our country and the success of our economy. It is the will that drives me to renovate vocational training, support young people towards employment and combat job insecurity. It's also the great idea of civic service, which I intend to relaunch. Ladies and Gentlemen, On this day, many peoples, first and foremost in Europe, are waiting and watching us. To overcome the crisis that has hit it, Europe needs projects. It needs solidarity. It needs growth. To our partners, I will propose a new pact that combines the necessary reduction in public debt with the indispensable stimulation of the economy. And I will tell them how necessary it is for our continent, in such an unstable world, to protect not only its values but also its interests, in the name of the principle of reciprocity in trade. France is a nation committed to the world. Through its history, its culture, its values of humanism, universality and freedom, it occupies a unique place in the world. The Declaration of the Rights of Man and of the Citizen has travelled the world. We must be its guardians, and stand shoulder to shoulder with all the democratic forces in the world that uphold its principles. France will respect all peoples; everywhere, it will be faithful to its vocation of defending the freedom of peoples, the honor of the oppressed and the dignity of women. At this moment when I am entrusted with presiding over the destiny of our country and representing it in the world, I salute my predecessors, all those who before me had the responsibility of leading the Republic: Charles de Gaulle, who put his prestige at the service of the greatness and sovereignty of France, Georges Pompidou, who made the industrial imperative a national issue; Valéry Giscard d'Estaing, who revitalized the modernization of society; François Mitterrand, who advanced freedoms and social progress; Jacques Chirac, who marked his attachment to the values of the Republic; Nicolas Sarkozy, to whom I offer my best wishes for the new life that lies ahead. Vive la République, Vive la France.
## 4 Ladies and Gentlemen, On this day when I officially take office as President of the French Republic, I am thinking of France, this old country that has been through so much and has always risen again, that has always spoken for all men, and that I now have the weighty task of representing in the eyes of the world. I am thinking of all the Presidents of the Fifth Republic who preceded me. I'm thinking of General De Gaulle, who twice saved the Republic, who restored France's sovereignty and the State's dignity and authority. I'm thinking of Georges Pompidou and Valéry Giscard d'Estaing who, each in their own way, did so much to bring France fully into the modern age. I'm thinking of François Mitterrand, who preserved the institutions and embodied political alternation at a time when it was becoming necessary for the Republic to belong to all French people. I'm thinking of Jacques Chirac, who for twelve years worked for peace and spread France's universal values throughout the world. I'm thinking of his role in making everyone aware of the imminence of ecological disaster, and of the responsibility of each and every one of us towards future generations. But at this solemn moment, my thoughts go first and foremost to the French people, who are a great people with a great history, and who rose up to express their faith in democracy, to say that they no longer wished to suffer. I'm thinking of the French people, who have always overcome hardship with courage and found within themselves the strength to transform the world. I think with emotion of this expectation, this hope, this need to believe in a better future that was so strongly expressed during the campaign that has just ended. I think with gravity of the mandate that the French people have entrusted to me, and of this strong demand that they carry within them and that I have no right to disappoint. We need to bring the French together, because France is only strong when it is united, and today it needs to be strong to meet the challenges it faces. We must keep our word and keep our promises, because never before has trust been so shaken and so fragile. Moral imperative, because never before has the crisis of values been so profound, never before has the need to find one's bearings been so strong. We need to restore the values of work, effort, merit and respect, because these values are the foundation of human dignity and the condition for social progress. Tolerance and openness, because intolerance and sectarianism have never been so destructive, and because it has never been so necessary for all women and men of good will to pool their talents, their intelligence and their ideas to imagine the future. The need for change, because never has standing still been so dangerous for France as in this fast-changing world, where everyone is striving to change faster than everyone else, and where any delay can be fatal and quickly become irrecoverable. The need for security and protection, because it has never been more necessary to fight against the fear of the future and the feeling of vulnerability that discourage initiative and risk-taking. We need order and authority, because we have given in too much to disorder and violence, which are primarily detrimental to the most vulnerable and humble. A demand for results, because the French are fed up with the fact that nothing in their daily lives ever improves, because the French are fed up with the fact that their lives are ever heavier, ever harder, because the French are fed up with the sacrifices imposed on them with no results. A demand for justice, because it's been a long time since so many French people have felt such a strong sense of injustice, or that sacrifices weren't fairly distributed, or that rights weren't equal for all. The need to break with past behaviour, habits of thought and intellectual conformism, because never before have the problems to be solved been so unprecedented. The people have entrusted me with a mandate. I will fulfill it. I will fulfill it scrupulously, with the determination to be worthy of the trust placed in me by the French people. I will defend France's independence and identity. I will ensure respect for the authority of the State and its impartiality. I will strive to build a Republic founded on real rights and irreproachable democracy. I will fight for a Europe that protects, for the union of the Mediterranean and for the development of Africa. I will make the defense of human rights and the fight against global warming the priorities of France's diplomatic action in the world. The task will be difficult, and it will have to be a long-term one. Each and every one of you, in your place in the State and each and every citizen in his or her place in society, has a role to play. I want to express my conviction that, in the service of France, there are no sides. There is only the good will of those who love their country. There are only the skills, ideas and convictions of those driven by a passion for the common good. To all those who wish to serve their country, I say that I am ready to work with them, and that I will not ask them to renounce their convictions, betray their friendships or forget their history. It's up to them to decide, in their soul and conscience as free men, how they want to serve France. On May 6, there was only one victory, that of the France that doesn't want to die, that wants order but also movement, that wants progress but also fraternity, that wants efficiency but also justice, that wants identity but also openness. On May 6, there was only one winner: the French people, who don't want to give up, who don't want to be locked into immobilism and conservatism, who no longer want to be decided for them, or thought for them. Well, to this France that wants to go on living, to this people that doesn't want to give up, who deserve our love and respect, I want to express my determination not to disappoint them. Vive la République, Vive la France.
## 5 Mr President of the Constitutional Council, Mr. Prime Minister, Ladies and Gentlemen, The French people have renewed their trust in me. The duties I owe to each and every one of them will be constantly present in my mind, today and for the five years of the mandate they have given me. I approach this mandate driven by a spirit of service, with the concern to bring the Republic to life, a Republic rooted in our hearts, a Republic attentive to all, open, humane, tolerant, which meets the expectations and needs of each and every one of our compatriots. I am fully aware of the demands placed on the office of President, particularly in the current period. By defeating the temptation of extremism, the French people have just forcefully reaffirmed their attachment to their democratic institutions, to public freedoms, to our European commitment and to our universal vocation. The first requirement is national cohesion. The French nation, forged by history, is a community of values and destinies. It recognizes diversity, is enriched by differences, and asserts its pluralism. But by listening to and respecting each other, it has always given priority to what unites over what divides. Faithful to the humanist ideal that has guided the French people since the proclamation of the rights of man and citizen, I will ensure that the principles of liberty, equality and fraternity constantly inspire the actions of its government. For me, this means reinforced solidarity. Solidarity that is concretely attentive to the difficulties of every French citizen. Solidarity that reduces precariousness and restores hope to those who have lost it. Solidarity that safeguards the social protection of which I am the guarantor, for health, for the family, for pensions. It also means greater confidence in our compatriots, through the full exercise of local freedoms, renewed social dialogue and support for the nation's driving forces. It means reinforcing equality of opportunity, from school to work, and equal access to culture. Finally, it means equal rights for all in France. The unity of the Republic is an essential requirement for me. France must put an end to the times when civic reference points were blurred. France is one and indivisible. Every French citizen has the same fundamental rights and duties, every French citizen belongs to the same people, and every French citizen holds a piece of national sovereignty. The President of the Republic is the guardian of this unity. Its rules must be respected, as must its symbols, for which so many of our compatriots have lost their lives. To ensure that these higher imperatives of national cohesion and the unity of the Republic are respected, the authority of the State must be reaffirmed. And it will be. It is a major requirement of this five-year term. Restoring the security of the French people depends on it, as do their freedom, their equality, their peace of mind, and a better quality of life, enabling them to act, to undertake, to build, to make plans, to commit themselves. Action is underway. I'm personally committed to it. In these first years of the new century, France will have to take up new challenges to consolidate its place in Europe and the world. We must approach them with confidence. France has many assets. Our country can and must develop them further. Many of our compatriots are understandably worried and sometimes anxious about the way the world is moving. The globalization of economies is a source of trade, wealth creation, activity and new jobs. But it also destroys other jobs. It leads to unbridled exploitation of the planet's natural resources. In France and throughout the world, many of the most vulnerable women, men and children are seeing their situation become increasingly precarious. Internationally and domestically, they expect governments to take action to ensure that globalization benefits all, while respecting everyone. The globalization of economies must go hand in hand with the globalization of solidarity. France, true to its traditions, must be at the forefront of this struggle. It must be the nation of this struggle. Our country has an essential role to play in mobilizing the international community. It will know how to act to reduce the uncertainties and instability of a world troubled by conflicts between peoples, by underdevelopment, by the violation of fundamental rights and freedoms, and by the eruption of new forms of terrorism, of which several of our compatriots, alas! have just been victims. To contribute to progress in world organization, France must be strong, and assert its place and standing. It must have the economy of a great nation. It must sustain a military effort worthy of its influence and a guarantee of its security. It must make a determined commitment to ensuring that Europe expresses itself forcefully on the international stage, and that it has a united presence and will. Finally, France must live up to the expectations of so many friendly peoples for whom the French-speaking world is synonymous with freedom, justice and culture. The hopes and expectations of our compatriots are immense. I want to meet them. They can count on my commitment to serve the general interest, a general interest that goes far beyond all particular interests, all partisan interests. That's how I see my job. And that's the mandate that the French people in Metropolitan France, overseas and abroad have just entrusted to me. I'll live up to it. Vive la République, Vive la France.
## 6 Presidents, Ladies and Gentlemen Ladies and Gentlemen, On this day when I take on the responsibility of assuming the highest office in the land, I feel myself the guardian of a hope. The presidential election was not the victory of one France against another, of one ideology against another. It was the victory of a France that wants to give itself the means to enter the third millennium strong and united. On May 7, the French people expressed their desire for change. I am determined to make the next seven years a period of dignity, simplicity and loyalty to the essential values of our Republic. My sole ambition will be to make the French people more united, more equal, and France more attractive, strengthened by its history and its assets. I will do everything to ensure that an impartial State, fully assuming its missions of sovereignty and solidarity, is the guarantor of citizens' rights and the protector of their freedoms. I will do my utmost to ensure that our democracy is strengthened and better balanced, through a fair division of powers between the executive and legislative branches, as intended by General de Gaulle, founder of the Fifth Republic. The President will arbitrate, set the broad directions, ensure the unity of the Nation and preserve its independence. The Government will conduct the Nation's policies. Parliament will make laws and oversee government action. These are the paths to follow. I will ensure that an independent judiciary is provided with the additional resources it needs to carry out its task. Above all, I will commit all my energies to restoring France's cohesion and renewing the Republican Pact between the French people. Employment will be my constant concern. The campaign that is drawing to a close has enabled our country to discover itself as it is, with its scars, its fractures, its inequalities, its outcasts, but also with its ardor, its generosity, its desire to dream and to make dreams a reality. France is an old country, but it is also a young, enthusiastic nation, ready to unleash the best of itself as long as it is shown the horizon, and not the narrowness of closed walls. President François Mitterrand has left his mark on the past fourteen years. A new seven-year term is beginning. At the end of my term of office, I would like the French people to see that the hoped-for change has been achieved. I would like all our compatriots to feel more confident about their personal future, and to feel part of a collective destiny. I would like these years, heavy with challenges but open to all possibilities, to see them become more confident, more united, more patriotic, and at the same time more European, because inner strength is always the source of outward momentum. With the help of men and women of good will, in accordance with the spirit and the letter of our institutions, and also with the idea I have of my mission, I will be with the French people, the guarantor of the public good, in charge of France's higher interests in the world and the universality of its message. Vive la République, Vive la France.
## 7 Mr. President of the Constitutional Council, Ladies and Gentlemen, On the threshold of this seventh term of office, I would like to interpret in as few words as possible the popular will expressed on May 8th. I will do so with an eye to the future, without recounting the past, and I will ask this question: What essential lesson can I draw from the event that has earned me the right to assume the supreme magistracy today, in the continuity of our institutions and my own mandate? The answer is obvious: from the heart and from reason, France aspires to rally its forces in respect of its values, the values of the Republic. And when I say France, I mean the vast majority of French people. This is the theme on which I made my commitment to the country. Our people have ratified it. Beyond the vicissitudes of the moment, the hesitations, the delays the normal after-effects of our competitions or the slowness of History trapped in its habits I intend to persevere. I will apply this paraphrase of a famous expression by Jaurès to my daily actions, confident that, for the most part, love of country and attachment to democracy will take precedence over quarrelling. Let's say it again and again. The month of May 1988 did not see the good guys win out over the bad guys, nor the opposite. I don't like this summary dialectic. Even if I deeply believe in the rightness of the principles in the name of which nearly seventeen million French people have placed their trust in me, even if I remain ardently attached to the ideal served by freedom-loving socialists since the dawn of industrial societies. Respect for one another is the basis of the pact without which the national community would lose its true meaning. But an unjust France is a divided France. A France closed in on itself and its divisions is, or would be, unfit to meet the challenges awaiting it in the global arena, and even more so in the borderless Europe of tomorrow. This is why I do not separate the political duty of openness from the social obligation of solidarity, nor the obligation of solidarity from the spirit of enterprise, the spirit of initiative that we need more than ever. Democratize society, reject exclusion, seek equality of opportunity, educate young people, train them in the trades and techniques that will provide them with job security in modernized companies, increase knowledge, serve the creation of minds and hands, curing the daily life of the majority of French people of its many defects, and sometimes of its intolerable servitudes, giving priority to dialogue here and over there at the other end of the planet this is the path we must take, the meeting to which I invite you if we want the "hope-principle" to triumph over the impulses of fear and confrontation. In short, it is the victory of the Republic that we must ensure together. The Republic belongs to no one. We are all, in different capacities, its guarantors and artisans. On the construction site of these ever-new values, in the daily battles for liberty, equality and fraternity, no volunteer is too many. Next year will mark the second centenary of our founding. My dear compatriots, it is my duty above all else, in the name of the Nation as a whole, to ensure that the general interest prevails over individual or partisan interests. You can count on me. I won't exaggerate France's role if I remind you that what she does and how she acts is of interest to the whole world. We all know France's message of peace, justice and progress. I address it once again to all the peoples of the world. Vive la République, Vive la France.
## 8 Mr Mayor, ladies and gentlemen, Mayor Jacques Chirac, I would like to thank you for the wishes you have just expressed for the success of this new period in the history of the Republic, as well as for the wishes you have expressed for the change that France has just affirmed its desire for. It's true that I've come here in accordance with tradition, but even more than tradition, history has made it my duty. On a summer's day in 1792, the first French Republic was born in Paris. It proposed universal suffrage and, with it, those new words that have since circumnavigated the globe: the rights of man and the citizen. It was a difficult and painful childhood, so often fought against, sometimes even defeated, but always reborn from popular revival. Yes, it's in Paris that we can best speak of the Republic and liberty. And it's at Paris City Hall that we can best speak of the Republic and equality. As the first counterweight to the lord's castle, the town hall asserted itself as the common house, the old face-to-face of king and provost, court and city, and later as a counterfeit of Versailles and the Commune. 1830, 1848, 1870, 1871 - there's no point in going over the dates, many of which have become celebrations, but let's not forget that they were first and foremost battles. Absolutism does not forgive municipal power. This one, less than any other. It's no coincidence that Napoleon Bonaparte abolished the Paris city council in favor of the prefects, and it's no coincidence that Louis-Napoleon in turn increased the State's control over the city. Victor Hugo said: "He who speaks to Paris speaks to the whole world". Today, through you, I prefer to address all the communes of France. I've been mayor, I'm still a municipal councillor, I know that here beats the heart of Paris, that it's here at last that we can speak, and that I must speak, of the Republic and fraternity. I have a vivid memory of August 25, 1944. A few days earlier, Paris had taken up arms, and the Parisian Liberation Committee and the Resistance Council had made this town hall, after the police headquarters, the symbol, the figurehead of a liberated France, liberated by itself. August 25, August 26, I lived through those days, 37 years ago, I was there, among others, to receive General de Gaulle, like him and like so many others, I listened to the deep rumor of the crowd climbing towards the windows, like him and like so many others, I felt, as he wrote in his "Mémoires de Guerre", the sacred emotion that embraces us all, men and women, in those minutes that surpass each of our poor lives. At that minute, France was fraternal. As you said, Mayor Jacques Chirac, there is much to be done. But nothing can be done without fraternity and nothing without justice. At a time when it is possible to put aside, if only for a moment, the harshness of political competition, who better than the President of the Republic to measure the effort that needs to be made? Who better than he to express the deep desire of our people to unite? Everyone will, of course, remain faithful to their own choices and preferences, and I have no intention of wavering from the commitments I made to universal suffrage in response to the desire for change of the French men and women who put their trust in me. Debate and the expression of differences are legitimate and even necessary in a democracy, but beyond confrontation I appeal to the cohesion of our country, a source of vitality and a guarantee of our strength, to confront the problems of our time. Yes, Mr Mayor, there is much to be done. Paris, the city of lights, is also the city of imagination because it is a city of memory. Let us now invent the future. Vive Paris! Vive la République!
## 9 Presidents, Ladies and Gentlemen, today marks a new era in French politics. This is not only due, Mr. President of the Constitutional Council, to the proclamation of the result that you have just recalled and whose honor, out of respect for France and its long history, I measure. This is not only due to the 13396203 women and men who have placed their trust in me to designate me to become the twentieth President of the French Republic. It is due to the totality of the votes cast on May 19th 1974. These votes, equal according to the democratic rule, from men and women, young and old, workers and non-workers, who each expressed their desire for change in their own way and according to their preference. As the new President of the Republic, I would like to extend my first greetings to those who aspired to become President of the Republic and who had the ability to do so, in particular Mr. Francois Mitterrand and Mr. Jacques Chaban-Delmas. So it is I who will lead the change, but I won't be leading it alone. If I intend to fully assume the task of President, and if I accept the responsibilities that such an attitude implies, the action to be undertaken will associate the government in its initiatives and parliament in its control and rights. I won't be leading it alone, because I have listened to, and am still listening to, the immense rumor of the French people, who have asked us for change. We will make this change with them, for them, as they are in their numbers and in their diversity, and we will lead it in particular with their youth, who carry like torches the joy and the future. Messieurs les Présidents, Mesdames, Mesdemoiselles, Messieurs, this is the opening of the book of time, with its dizzying blank pages. Together, as one great, united and fraternal people, let us embark on the new era of French politics.
## Date
## 1 07/05/2022
## 2 14/05/2017
## 3 15/05/2012
## 4 16/05/2007
## 5 16/05/2002
## 6 17/05/1995
## 7 21/05/1988
## 8 21/05/1981
## 9 27/05/1974
## Source
## 1 https://www.vie-publique.fr/discours/285059-emmanuel-macron-07052022-investiture-president-de-la-republique
## 2 https://www.vie-publique.fr/discours/202852-declaration-de-m-emmanuel-macron-president-de-la-republique-sur-les-p
## 3 https://www.vie-publique.fr/discours/185063-francois-hollande-15052012-projet-pour-la-france
## 4 https://www.vie-publique.fr/discours/166669-declaration-de-m-nicolas-sarkozy-president-de-la-republique-sur-les-p
## 5 https://www.vie-publique.fr/discours/128512-declaration-de-m-jacques-chirac-president-de-la-republique-loccasi
## 6 https://www.vie-publique.fr/discours/203802-discours-de-m-jacques-chirac-president-de-la-republique-sur-son-role
## 7 https://www.vie-publique.fr/discours/139559-allocution-de-m-francois-mitterrand-president-de-la-republique-le-jou
## 8 https://www.vie-publique.fr/discours/135390-francois-mitterrand-21051981-jour-de-son-investiture-hotel-ville-paris
## 9 https://www.vie-publique.fr/discours/262853-allocution-de-m-valery-giscard-destaing-loccasion-de-sa-prise-de-fo
# Add a column containing for each speech, its length
speeches_length <- speeches_data %>%
mutate(Length = nchar(Speech))
# Historical order
speeches_length$President <- factor(speeches_length$President,
levels = c("Valéry Giscard d'Estaing (1974)", "François Mitterrand (1981)", "François Mitterrand (1988)", "Jacques Chirac (1995)", "Jacques Chirac (2002)", "Nicolas Sarkozy (2007)", "François Hollande (2012)", "Emmanuel Macron (2017)", "Emmanuel Macron (2022)"))
# Create a speech length bar graph to compare them
ggplot(speeches_length, aes(x = President, y = Length)) +
geom_bar(stat = "identity", fill = "blue") +
labs(x = "President", y = "Speech Length") +
ggtitle("Inauguration Speech Length Comparison") +
theme(plot.title = element_text(face = "bold", hjust = 0.5), # Bold title, centered
panel.grid.major.x = element_blank(), # Remove x-axis grid lines
axis.text.x = element_text(angle = 45, hjust = 1)) # Rotate x-axis labels for better readability
english_stopwords <- stopwords("en")
french_stopwords <- stopwords("fr")
speeches_tidy <- speeches_data %>%
# Group by President
group_by(President) %>%
# Tokenize
unnest_tokens(output = word, input = Speech) %>%
# Added line number for future analysis (one line contains 10 words)
mutate(line_number = ceiling(row_number() / 10)) %>%
# Remove stop words
anti_join(data.frame(word = english_stopwords), by = "word") %>%
anti_join(data.frame(word = french_stopwords), by = "word") # Uncoment if you want stemming %>%
# Apply stemming
# Uncoment if you want stemming mutate(word = wordStem(word, language = "en"))
speeches_tidy
## # A tibble: 3,792 × 3
## # Groups: President [9]
## President word line_number
## <chr> <chr> <dbl>
## 1 Emmanuel Macron (2022) ladies 1
## 2 Emmanuel Macron (2022) gentlemen 1
## 3 Emmanuel Macron (2022) time 1
## 4 Emmanuel Macron (2022) french 1
## 5 Emmanuel Macron (2022) entrusted 2
## 6 Emmanuel Macron (2022) highest 2
## 7 Emmanuel Macron (2022) office 2
## 8 Emmanuel Macron (2022) acutely 3
## 9 Emmanuel Macron (2022) aware 3
## 10 Emmanuel Macron (2022) seriousness 3
## # … with 3,782 more rows
# Extract the top 10 words in terms of frequency from each president's speeches
top10tf <- speeches_tidy %>%
count(President, word) %>%
group_by(President) %>%
slice_max(n, n = 10, with_ties = F) # False to avoid multiple elements with the same value
# Historical order
top10tf$President <- factor(top10tf$President,
levels = c("Valéry Giscard d'Estaing (1974)", "François Mitterrand (1981)", "François Mitterrand (1988)", "Jacques Chirac (1995)", "Jacques Chirac (2002)", "Nicolas Sarkozy (2007)", "François Hollande (2012)", "Emmanuel Macron (2017)", "Emmanuel Macron (2022)"))
# Define my color palette
my_colors <- c("blue", "red", "red", "orange", "orange", "green", "magenta", "brown", "brown")
# Create the top 10 tf bar graph
ggplot(top10tf, aes(x = reorder_within(word, n, President), # To order by word frequency
y = n,
fill = President)) +
geom_col(show.legend = F) + # To remove President legend
coord_flip() + # To flip axis
facet_wrap(~President, scales = "free", ncol = 2) + # To remove unused top10 words + space on x axis
scale_x_reordered() + # To remove x axis legends
scale_fill_manual(values = my_colors) + # To use my defined colors
labs(x = NULL) + # To remove reorder labels
ggtitle("Top 10 words by Term Frequency") +
theme(plot.title = element_text(face = "bold", hjust = 0.5), # Bold title, centered
panel.grid.major.y = element_blank()) # Remove y-axis grid lines
\[{\large\text{TF-IDF} = TF{\times}\log\frac{{\text{N}}}{{\text{DF}}}}\]
# - An indicator of the degree to which a word is uncommon but frequently used in a specific text
# - Used to find key words that reveal the personality of a text
# Extract the top 10 words in terms of tf-idf from each president's speeches
top10tfidf <- speeches_tidy %>%
count(President, word) %>%
# Combine the term frequency (TF) and inverse document frequency (IDF) calculations into a single step
bind_tf_idf(term = word, # Word
document = President, # Text delimiter
n = n) %>% # Word frequency
group_by(President) %>%
slice_max(tf_idf, n = 10, with_ties = F) # False to avoid multiple elements with the same value
# Historical order
top10tfidf$President <- factor(top10tfidf$President,
levels = c("Valéry Giscard d'Estaing (1974)", "François Mitterrand (1981)", "François Mitterrand (1988)", "Jacques Chirac (1995)", "Jacques Chirac (2002)", "Nicolas Sarkozy (2007)", "François Hollande (2012)", "Emmanuel Macron (2017)", "Emmanuel Macron (2022)"))
# Create the top 10 tf-idf bar graph
ggplot(top10tfidf, aes(x = reorder_within(word, tf_idf, President), # To order by tf-idf
y = tf_idf,
fill = President)) +
geom_col(show.legend = F) + # To remove President legend
coord_flip() + # To flip axis
facet_wrap(~President, scales = "free", ncol = 2) + # To remove unused top10 words + space on x axis
scale_x_reordered() + # To remove x axis legends
scale_fill_manual(values = my_colors) + # To use my previous defined colors
labs(x = NULL) + # To remove reorder labels
ggtitle("Top 10 words by Term Frequency - Inverse Document Frequency") +
theme(plot.title = element_text(face = "bold", hjust = 0.5), # Bold title, centered
panel.grid.major.y = element_blank()) # Remove y-axis grid lines
Most of the time, we use ‘nrc’ lexicon only for pure sentiment analysis (positive or negative). Nonetheless, this lexicon contains also 8 emotions. Let’s use them to implement a more exhaustive analysis.
# Define a chunk (group of lines)
chunk_size <- 20 # lines
# Get sentiment dataframe
speeches_sentiment <- speeches_tidy %>%
inner_join(get_sentiments("nrc")) %>% # Use 'nrc' lexicon
count(President, index = line_number %/% chunk_size, sentiment) %>% # Create chunk
group_by(President, index) %>%
mutate(total_words = sum(n)) %>%
ungroup() %>%
pivot_wider(names_from = sentiment, values_from = n, values_fill = 0) %>% # Reshape table
mutate_at(vars(anger, anticipation, disgust, fear, joy, sadness, surprise, trust), ~ . / total_words * 100) # Calculate a percentage for each sentiment
# Historical order
speeches_sentiment$President <- factor(speeches_sentiment$President,
levels = c("Valéry Giscard d'Estaing (1974)", "François Mitterrand (1981)", "François Mitterrand (1988)", "Jacques Chirac (1995)", "Jacques Chirac (2002)", "Nicolas Sarkozy (2007)", "François Hollande (2012)", "Emmanuel Macron (2017)", "Emmanuel Macron (2022)"))
# Define a custom color palette for each sentiment
sentiment_palette <- c("anger" = "red", "anticipation" = "lightgreen", "disgust" = "pink",
"fear" = "darkgray", "joy" = "yellow", "negative" = "darkred",
"positive" = "darkgreen", "sadness" = "purple", "surprise" = "orange",
"trust" = "blue")
# Reshape the data into long format
speeches_sentiment <- speeches_sentiment %>%
tidyr::pivot_longer(cols = c(anger, anticipation, disgust, fear, joy, negative, positive, sadness, surprise, trust),
names_to = "Sentiment",
values_to = "Percentage")
# Create the stacked bar graph
ggplot(speeches_sentiment, aes(x = factor(index), y = Percentage, fill = Sentiment)) +
geom_bar(stat = "identity", position = "stack") +
facet_wrap(~President, ncol = 2, scales = "free_x") +
labs(x = paste0("Chunk (", chunk_size, " lines)"), y = "Percentage") + # Dynamic legend
ggtitle("Sentiment Analysis by Chunk and President") +
theme(plot.title = element_text(face = "bold", hjust = 0.5), # Bold title, centered
panel.grid.major.y = element_blank()) + # Remove y-axis grid lines
scale_fill_manual(values = sentiment_palette) # Use our custom color palette
As you know, President Macron is the actual French President but was already President before. Let’s compare his two investiture speeches to find some differences. For this purpose, what’s better than using log odds ration method. \[{\large\text{log odds ratio} = \log{\left(\frac{\left(\frac{n+1}{\text{total}+1}\right)_\text{Text A}} {\left(\frac{n+1}{\text{total}+1}\right)_\text{Text B}}\right)}}\]
# Extract the top 10 words in terms of log odds ratio from Macron's speeches (2017 and 2022)
top10lor <- speeches_tidy %>%
filter(President %in% c("Emmanuel Macron (2017)", "Emmanuel Macron (2022)")) %>%
count(President, word) %>%
pivot_wider(names_from = President,
values_from = n,
values_fill = list(n = 0)) %>%
rename(EM2017 = `Emmanuel Macron (2017)`,
EM2022 = `Emmanuel Macron (2022)`) %>%
# Add `+1` to all values so that the frequency is greater than zero
mutate(ratio_EM2017 = ((EM2017 + 1) / (sum(EM2017 + 1))), # Weight of words in EM2017 speech
ratio_EM2022 = ((EM2022 + 1) / (sum(EM2022 + 1))), # Weight of words in EM2022 speech
odds_ratio = ratio_EM2017 / ratio_EM2022,
log_odds_ratio = log(odds_ratio)) %>%
group_by(President = ifelse(log_odds_ratio > 0, "EM2017", "EM2022")) %>%
slice_max(abs(log_odds_ratio), n = 10, with_ties = F) %>%
select(word, log_odds_ratio, President)
# Refill president column with President's full name
top10lor$President[top10lor$President == "EM2017"] <- "Emmanuel Macron (2017)"
top10lor$President[top10lor$President == "EM2022"] <- "Emmanuel Macron (2022)"
# Historical order
top10lor$President <- factor(top10lor$President,
levels = c("Emmanuel Macron (2017)", "Emmanuel Macron (2022)"))
# Create the top 10 log odds ratio bar graph
ggplot(top10lor, aes(x = reorder_within(word, log_odds_ratio, President), # To order by log odds ratio
y = log_odds_ratio,
fill = President)) +
geom_col(show.legend = F) + # To remove President legend
coord_flip() + # To flip axis
facet_wrap(~President, scales = "free", ncol = 2) + # To remove unused top10 words + space on x axis
scale_x_reordered() + # To remove x axis legends
labs(x = NULL) + # To remove reorder labels
ggtitle("Top 10 words by Log Odds Ration for Macron's speeches") +
theme(plot.title = element_text(face = "bold", hjust = 0.5), # Bold title, centered
panel.grid.major.y = element_blank()) # Remove y-axis grid lines
Goal: Compare for each speech the distribution of positive and negative words. Then, to compare only the positive and negative aspects, let’s use “bing”, which is the most inclusive lexicon for this.
speeches_posneg <- speeches_tidy %>%
inner_join(get_sentiments("bing")) %>% # Use 'bing' lexicon
count(President, sentiment) %>%
group_by(President) %>%
mutate(percentage = n / sum(n) * 100) %>% # Compute distribution in %
rename(Sentiment = sentiment) # Rename sentiment column for aesthetics reason (legend displaying)
# Historical order
speeches_posneg$President <- factor(speeches_posneg$President,
levels = c("Valéry Giscard d'Estaing (1974)", "François Mitterrand (1981)", "François Mitterrand (1988)", "Jacques Chirac (1995)", "Jacques Chirac (2002)", "Nicolas Sarkozy (2007)", "François Hollande (2012)", "Emmanuel Macron (2017)", "Emmanuel Macron (2022)"))
# Create the circular graphs
ggplot(speeches_posneg, aes(x = "", y = percentage, fill = Sentiment)) +
geom_bar(stat = "identity", width = 1, color = "white") +
geom_text(aes(
label = paste0(round(percentage), "%")), # Display percentage values on each graph
position = position_stack(vjust = 0.5),
color = "white",
size = 3) +
coord_polar("y", start = 0) +
facet_wrap(~President, strip.position = "bottom", ncol = 3, labeller = label_wrap_gen(width = 20)) +
scale_fill_manual(values = c("negative" = "red", "positive" = "darkgreen")) +
theme_void() + # Hide ugly graph details
ggtitle("Speeches positive/negative words distribution") +
theme(
legend.position = "right",
plot.title = element_text(face = "bold", hjust = 0.5),
strip.text = element_text(size = 8, face = "bold"),
legend.margin = margin(t = 10, r = 10, b = 10, l = 50)
)
By making a network graph with Bigrams, we can:
# Creating our Bigrams data frame
bigram_speeches <- speeches_data %>%
unnest_tokens(input = Speech,
output = bigram,
token = "ngrams",
n = 2) %>%
separate(bigram, c("word1", "word2"), sep = " ") %>%
# Remove stop words
filter(!word1 %in% c(english_stopwords, french_stopwords),
!word2 %in% c(english_stopwords, french_stopwords)) %>%
count(word1, word2, sort = T) %>%
# Remove NA values after stop words cleaning
na.omit()
# Creating a network graph data
graph_bigram <- bigram_speeches %>%
# Flimsy filter (we don't have a lot of data here)
filter(n >= 3) %>%
as_tbl_graph(directed = F) %>%
mutate(centrality = centrality_degree(), # Compute centrality
group = as.factor(group_infomap())) # Compute community
# Creating our Bigrams network graph
set.seed(1234)
ggraph(graph_bigram, layout = "fr") +
geom_edge_link(color = "gray50", # Edge color
alpha = 0.5) + # Edge contrast
geom_node_point(aes(size = centrality, # Node size
color = group), # Node color
show.legend = F) + # Legend removal
scale_size(range = c(5, 10)) + # Range of node size
geom_node_text(aes(label = name),
repel = T,
size = 5) +
theme_graph() +
ggtitle("Speeches Bigrams network graph") +
theme(plot.title = element_text(face = "bold", hjust = 0.5)) # Bold title, centered
N-grams:
By making a network graph with Phi Coefficient, we can:
# Creating our Phi Coefficient data frame
phi_speeches <- speeches_tidy %>%
add_count(word) %>%
# Flimsy filter (we don't have a lot of data here)
filter(n >= 5) %>%
pairwise_cor(item = word, # Compute Phi Coefficient
feature = President,
sort = T)
# Creating a network graph data
graph_phi <- phi_speeches %>%
# Correlation must be equal or bigger than 0.05
filter(correlation >= 0.05) %>%
as_tbl_graph(directed = F) %>%
mutate(centrality = centrality_degree(),
group = as.factor(group_infomap()))
# Creating our Bigrams network graph
set.seed(1234)
ggraph(graph_phi, layout = "fr") +
geom_edge_link(color = "gray50",
aes(edge_alpha = correlation, # Edge contrast
edge_width = 1), # Edge thickness
show.legend = F) + # Legend removal
scale_edge_width(range = c(1, 2)) + # Edge thickness removal
geom_node_point(aes(size = centrality,
color = group),
show.legend = F) +
scale_size(range = c(5, 10)) +
geom_node_text(aes(label = name),
repel = T,
size = 5) +
theme_graph() +
ggtitle("Speeches Phi Coefficient network graph") +
theme(plot.title = element_text(face = "bold", hjust = 0.5)) # Bold title, centered
Phi coefficient: